# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=geary
pkgver=3.36.2
pkgrel=0
pkgdesc="Geary is an email application built around conversations"
url="https://wiki.gnome.org/Apps/Geary"
# libhandy is not available on s390x or mips
arch="all !s390x !mips !mips64"
license="LGPL-2.1-or-later AND CC-BY-3.0 AND BSD-2-Clause"
depends="iso-codes dbus:org.freedesktop.Secrets"
makedepends="meson glib-dev gtk+3.0-dev sqlite-dev webkit2gtk-dev enchant2-dev
	gcr-dev folks-dev libgee-dev gnome-online-accounts-dev json-glib-dev iso-codes-dev
	libcanberra-dev libnotify-dev libsecret-dev libxml2-dev vala gmime-dev itstool
	appstream-glib-dev gspell-dev ytnef-dev libhandy-dev libpeas-dev"
checkdepends="xvfb-run desktop-file-utils ibus"
options="!check" # https://gitlab.gnome.org/GNOME/geary/-/issues/776
subpackages="$pkgname-lang $pkgname-doc"
source="https://download.gnome.org/sources/geary/${pkgver%.*}/geary-$pkgver.tar.xz"

build() {
	meson \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--buildtype=plain \
		-Dlibunwind_optional=true \
		. output
	ninja -C output
}

check() {
	xvfb-run ninja -C output test
}

package() {
	DESTDIR="$pkgdir" ninja -C output install
}

sha512sums="a3cca301a3668eb2e70f8bfc147abef9088de4e822efab4ecc44830fbc394265d1fa37267a1f8fa97b6e8d1ac8a8adb76e5dd9e509490ac567e05bd243e8ea20  geary-3.36.2.tar.xz"
